#
# Copyright (C) 2020 The LineageOS Project
#
# SPDX-License-Identifier: Apache-2.0
#

# ANT+
PRODUCT_PACKAGES += \
    com.dsi.ant@1.0 \
    com.dsi.ant@1.0.vendor \
    com.qualcomm.qti.ant@1.0 \
    com.qualcomm.qti.ant@1.0.vendor 

# Alarm
PRODUCT_PACKAGES += \
    vendor.qti.hardware.alarm@1.0 \
    vendor.qti.hardware.alarm@1.0-service

#AuthSecret
PRODUCT_PACKAGES += \
    android.hardware.authsecret@1.0-service

# Audio
PRODUCT_PACKAGES += \
    android.hardware.audio@7.0-impl \
    android.hardware.audio.service \
    android.hardware.audio.effect@7.0-impl \
    android.hardware.audio.effect@2.0-service \
    android.hardware.bluetooth.a2dp@1.0-impl.mock \
    android.hardware.soundtrigger@2.0-core \
    android.hardware.soundtrigger@2.0 \
    android.hardware.soundtrigger@2.2-impl

# Audio
#PRODUCT_PACKAGES += \
#    vendor.qti.hardware.audiohalext@1.0-impl

# Bluetooth
PRODUCT_PACKAGES += \
    android.hardware.bluetooth@1.0 \
    android.hardware.bluetooth@1.0.vendor \
    android.hardware.bluetooth.audio@2.1-impl

PRODUCT_PACKAGES += \
    vendor.qti.hardware.bluetooth_audio@2.0.vendor \
    vendor.qti.hardware.btconfigstore@1.0.vendor

# Biometrics

PRODUCT_PACKAGES += \
    android.hardware.biometrics.fingerprint@2.2 \
    android.hardware.biometrics.fingerprint@2.2-service-qiku \

ifdef FP_VINTF
PRODUCT_PACKAGES += \
    manifest_android.hardware.biometrics.fingerprint@2.1-service
endif

# Camera
PRODUCT_PACKAGES += \
    android.frameworks.displayservice@1.0 \
    android.frameworks.displayservice@1.0.vendor \
    android.hardware.camera.provider@2.4-impl \
    android.hardware.camera.provider@2.5-service-lazy \
    vendor.qti.hardware.camera.device@1.0

# Configstore
PRODUCT_PACKAGES += \
    android.hardware.configstore@1.1-service

# Display
ifeq ($(TARGET_KERNEL_VERSION),$(filter $(TARGET_KERNEL_VERSION),4.14 4.19))
PRODUCT_PACKAGES += \
    android.hardware.graphics.mapper@3.0-impl-qti-display \
    android.hardware.graphics.mapper@4.0-impl-qti-display \
    vendor.qti.hardware.display.allocator-service
else
PRODUCT_PACKAGES += \
    android.hardware.graphics.mapper@2.0-impl-2.1 \
    android.hardware.graphics.allocator@2.0-impl \
    android.hardware.graphics.allocator@2.0-service

# Display Manifest
PRODUCT_PACKAGES += \
    manifest_android.hardware.display.composer-service \
    manifest_android.hardware.graphics.allocator \
    manifest_android.hardware.graphics.mapper-impl
endif

PRODUCT_PACKAGES += \
    android.hardware.graphics.composer@2.1 \
    android.hardware.graphics.composer@2.2-service \
    vendor.display.config@2.0 \
    vendor.display.config@2.0.vendor \
    android.hardware.memtrack-service-qiku

#PRODUCT_PACKAGES += \
#    vendor.display.color@1.3 \
#    vendor.display.postproc@1.0

# DRM
PRODUCT_PACKAGES += \
    android.hardware.drm@1.4-service.clearkey

#PRODUCT_PACKAGES += \
#    android.hardware.drm@1.0-impl \
#    android.hardware.drm@1.0-service \

# FM
PRODUCT_PACKAGES += \
    android.hardware.broadcastradio@1.0-impl \
    android.hardware.broadcastradio@2.0-service \
    vendor.qti.hardware.fm@1.0.vendor

# Health
PRODUCT_PACKAGES += \
    android.hardware.health@2.1-service \
    android.hardware.health@2.1-impl.recovery

ifdef BOARD_AOSP_HEALTH
PRODUCT_PACKAGES += \
    android.hardware.health@2.1-impl
else
PRODUCT_PACKAGES += \
    android.hardware.health@2.1-impl-qti
endif

# HW crypto
PRODUCT_PACKAGES += \
    vendor.qti.hardware.cryptfshw@1.0-service-qti.qsee

TARGET_ENABLE_GK_SOFTWARE := true
TARGET_ENABLE_KM_4_ := true

#ifneq ($(wildcard vendor/qiku/keymaster),)
#    TARGET_ENABLE_KM_4_0:= true
#endif

# Keystore
ifdef TARGET_ENABLE_GK_SOFTWARE
PRODUCT_PACKAGES += \
    android.hardware.gatekeeper@1.0-service.software
else
PRODUCT_PACKAGES += \
    android.hardware.gatekeeper@1.0-impl \
    android.hardware.gatekeeper@1.0-service \
    manifest_android.hardware.gatekeeper@1.0-service
endif

PRODUCT_PACKAGES += \
    android.hardware.gatekeeper@1.0 \
    android.hardware.gatekeeper@1.0.vendor

ifdef TARGET_ENABLE_KM_4_1
PRODUCT_PACKAGES += \
    android.hardware.keymaster@4.1 \
    android.hardware.keymaster@4.1-service
else ifdef TARGET_ENABLE_KM_4_0
PRODUCT_PACKAGES += \
    android.hardware.keymaster@4.0 \
    manifest_android.hardware.keymaster@4.0-service-qti

$(call inherit-product-if-exists, vendor/$(BOARD_VENDOR)/keymaster/keymaster-vendor.mk)
else
PRODUCT_PACKAGES += \
    android.hardware.keymaster@3.0 \
    android.hardware.keymaster@3.0-impl \
    android.hardware.keymaster@3.0-service \
    manifest_android.hardware.keymaster@3.0-service
endif

TARGET_ENABLE_LIGHT_AIDL_HAL := true

# Lights
ifdef TARGET_ENABLE_LIGHT_AIDL_HAL
#Enable Light AIDL HAL
PRODUCT_PACKAGES += \
    android.hardware.lights-service.qiku \
    android.hardware.light-V1-ndk_platform
else
#Enable Light HIDL HAL
PRODUCT_PACKAGES += \
    android.hardware.light@2.0-service.qiku_sdm660
endif

# Lineage Health
PRODUCT_PACKAGES += \
    vendor.lineage.health-service.default

# LiveDisplay
PRODUCT_PACKAGES += \
    vendor.lineage.livedisplay@2.0-service-sdm \
    vendor.lineage.livedisplay@2.0-service-sysfs

# Net
PRODUCT_PACKAGES += \
    android.system.net.netd@1.1.vendor

# Neural Networks
PRODUCT_PACKAGES += \
    android.hardware.neuralnetworks@1.2 \
    android.hardware.neuralnetworks@1.2.vendor

PRODUCT_PACKAGES += \
    vendor.qti.hardware.servicetracker@1.2

# Power
PRODUCT_PACKAGES += \
    android.hardware.power.stats@1.0-service.mock

PRODUCT_PACKAGES += \
    android.hardware.power-service-qti \
    vendor.qti.hardware.perf@2.2

# QseeComd
PRODUCT_PACKAGES += \
    qseecomd.rc \
    qseecomd \
    libQSEEComAPI \
    libdrmfs \
    vendor.qti.hardware.qseecom@1.0 \
    vendor.qti.hardware.qseecom@1.0-service \
    vendor.qti.hardware.qseecom@1.0-impl \
    vendor.qti.hardware.qseecom@1.0-service.rc

# Sensors
PRODUCT_PACKAGES += \
    android.hardware.sensors@1.0-service \
    android.hardware.sensors@1.0-impl \
    manifest_android.hardware.sensors@1.0-service

# RenderScript HAL
#PRODUCT_PACKAGES += \
#    android.hardware.renderscript@1.0-impl

# RIL
PRODUCT_PACKAGES += \
    android.hardware.radio@1.6 \
    android.hardware.radio@1.6.vendor \
    android.hardware.radio.config@1.3 \
    android.hardware.radio.config@1.3.vendor \
    android.hardware.radio.deprecated@1.0 \
    android.hardware.radio.deprecated@1.0.vendor \
    android.hardware.secure_element@1.2 \
    android.hardware.secure_element@1.2.vendor

# Thermal
PRODUCT_PACKAGES += \
    android.hardware.thermal@2.0-service.qti

#Touch
PRODUCT_PACKAGES += \
    vendor.lineage.touch@1.0-service.sdm660

# Trust HAL
PRODUCT_PACKAGES += \
    vendor.lineage.trust@1.0-service

# USB
PRODUCT_PACKAGES += \
    android.hardware.usb@1.0-service.basic

# Vibrator
ifdef TARGET_ENABLE_VIB_HIDL_HAL
PRODUCT_PACKAGES += \
    android.hardware.vibrator@1.0-impl \
    android.hardware.vibrator@1.0-service \
    manifest_android.hardware.vibrator@1.0-service
else
ifeq ((BOARD_BUILD_NEW_KERNEL),false)
    PRODUCT_PACKAGES += \
        vendor.qti.hardware.vibrator.service
else
    PRODUCT_PACKAGES += \
        android.hardware.vibrator.service-qiku
endif    
endif

# Weaver
PRODUCT_PACKAGES += \
    android.hardware.weaver@1.0

# WiFi
PRODUCT_PACKAGES += \
    android.hardware.wifi@1.0-service
